<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
    String error = request.getParameter("error") == null ? "" : request.getParameter("error").toString();
			String path = request.getContextPath();
			String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
					+ path + "/";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>欢迎登录后台管理系统</title>
<link href="../../css/login.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../easyui-1.5/jquery.min.js"></script>
<script type="text/javascript" src="../../js/jquery.browser.min.js"></script>
<script type="text/javascript" src="../../js/jquery.cookie.js"></script>
<script type="text/javascript" src="../../js/jquery.base64.js"></script>

<link rel="stylesheet" type="text/css"
	href="../../easyui-1.5/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css"
	href="../../easyui-1.5/themes/icon.css" />
<script type="text/javascript"
	src="../../easyui-1.5/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="../../easyui-1.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
	function backup() {
		$('#backup').linkbutton('disable');
	    $("#dlg").dialog("open").dialog("setTitle","提示信息");;
		$.ajax({
			type : 'POST',
			dataType : "json",
			url : "../manager/dbexport",
			error : function() {
			    $("#dlg").dialog( "close" );
				alert('请求失败');
			},
			success : function(data) {
				$('#backup').linkbutton('enable');
				if(data==1){
				    $("#dlg").dialog( "close" );
					alert("备份成功");
				}
				else{
				    $("#dlg").dialog( "close" );
					alert("备份失败");
				}
			}
		});//AJAX结束
	}
</script>
</head>
<body style="margin: 5px">
	<table id="rulepointinfo" title="数据管理" class="easyui-datagrid"
		fit="true" toolbar="#tb">
	</table>
	<div id="tb">
		<div>
			<form id="export" method="post">
				<div style="margin:0 auto; margin-left: 50px;">
					<div>&nbsp;</div>
					&nbsp;备份路径：&nbsp;<span>工程根目录下的backups文件夹</span>
					<div>&nbsp;</div>
					&nbsp;数据库文件名：&nbsp;<span>备份时间.sql(例如:20180308191822.sql，代表是2018年3月8号，19点18分22秒备份的)</span>
					<div>&nbsp;</div>
					&nbsp;知识文件名：&nbsp;<span>备份时间.zip(例如:20180308191822.zip，代表是2018年3月8号，19点18分22秒备份的)</span>
					<div>&nbsp;</div>
				</div>
				<a id="backup" style="margin:0 auto; margin-left: 50px" href="javascript:backup()" class="easyui-linkbutton"
					iconCls="icon-export" plain="true">开始备份</a>
				<div>&nbsp;</div>
			</form>
		</div>
		<div id="dlg" class="easyui-dialog" style="width: 300px;height: 100px;padding: 10px 20px" closable="false" closed="true" >
			<span style="margin-left:50px;margin-top:50px">正在进备份,请稍后...</span>
		</div>
	</div>

</body>

</html>
